import java.util.Arrays;
import java.util.Scanner;

public class demo02 {
    //最少刷题数
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int[] arr=new int[n];
        for (int i = 0; i < n; i++) {
            arr[i]=sc.nextInt();
        }
        for (int i = 0; i < n; i++) {
            int[] tmp=new int[n-1];
            for (int j = 0; j < i; j++) {
                tmp[j]=arr[j];
            }
            for (int j = i+1; j < n; j++) {
                tmp[j-1]=arr[j];
            }
            Arrays.sort(tmp);
            int num=0;
            int mid=(tmp.length-1)/2;
            if(tmp[mid]-arr[i]>0) {
                num = tmp[mid] - arr[i]+1;
                System.out.print(num + " ");
            }else {
                System.out.print(0 + " ");
            }
        }
    }
}
